<?php
function accept_header_to_list($header){

	$mimes = explode(',',$header);
	$accept_mimetypes = array();
	foreach($mimes as $mime){
		$parts = explode(';q=', $mime);
		if(count($parts)>1){
			$accept_mimetypes[$parts[0]]=$parts[1];
		}
		else{
			$accept_mimetypes[$mime]=1;
		}
	}
	arsort($accept_mimetypes);
	return array_keys($accept_mimetypes);

}


?>